var mongoose = require('mongoose');
//连接数据库
mongoose.connect('mongodb://localhost/test', {useNewUrlParser: true});
var Schema = mongoose.Schema;

var userSchma = new Schema({
    email:{
        type:String,
        required:true
    },
    account:{
        type:String,
        required: true
    },
    password:{
        type:String,
        required:true
    },
    name:{
        type:String,
        required:true
    },
    created_time:{
        type:Date,
        default:Date.now
    },
    last_modified_time:{
        type:Date,
        default:Date.now
    },
});

module.exports = mongoose.model('User', userSchma);